package com.dindang.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dindang.service.GoodsService;
import com.dindang.service.impl.GoodsServiceImpl;

@WebServlet("/deleteGoods.do")
public class DeleteGoodsServlet extends HttpServlet{
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		try {
			int goodsId = Integer.parseInt(req.getParameter("goodsId"));
			GoodsService gs = new GoodsServiceImpl();
			gs.deleteGoods(goodsId);
		}catch(Exception e) {
			
		}
		resp.sendRedirect("getGoods.do");
	}

}
